<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<script type="text/javascript">
			//求阶乘
			/*当i=1的时候，计算1的阶乘1*1 赋值给n . n=1  */
			var sum = 1;
			var num = 0;
			for (var i = 1; i <= 20; i++) {
				sum *= i;
				// num += sum;
				console.log(sum);
			}
		</script>
	</body>
</html>
